package unittest;





import org.junit.Assert;
import org.junit.Test;

import java.util.Arrays;

/**
 * @author: 叶子
 * @date: 2021/11/24 23:39
 **/
public class UnitTest {
    public int tt(String s){
        String [] ss= s.split("\\+");
        System.out.println(s+"--->"+ Arrays.toString(ss));
        int sum = 0;
        for (String a: ss){
            sum+=Integer.parseInt(a.trim());
        }
        return sum;
    }
    @Test
    public void  test(){
        Assert.assertEquals(6,new UnitTest().tt("1+2+3"));
        Assert.assertEquals(5,new UnitTest().tt("1+2+3"));
    }
}